import BTAction from 'db://app-game/libs/math/behavior-tree/base/BTAction';
import { NodeStatus } from 'db://app-game/libs/math/behavior-tree/enum';
import { Monster } from '../../ecs/biz/monster/Monster';

/** 怪兽攻击 */
export default class ActionMonsterAttack extends BTAction {
  onUpdate(monster: Monster): NodeStatus {
    console.log('ActionMonsterAttack——————怪兽攻击');

    // 6.攻击
    const attack = monster.attack();
    if (attack) {
      return NodeStatus.Success;
    }
    return NodeStatus.Failure;
  }
}
